Replace several implementation of blank cursor setting by
authorMatthias Clasen <matthiasc@src.gnome.org>
Tue, 20 Jan 2009 02:45:19 +0000 (02:45 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 20 Jan 2009 02:45:19 +0000 (02:45 +0000)
        * gtk/gtkentry.c:
        * gtk/gtkfilechooserentry.c:
        * gtk/gtktextview.c: Replace several implementation of
        blank cursor setting by GDK_BLANK_CURSOR.

svn path=/trunk/; revision=22148

ChangeLog
gtk/gtkentry.c
gtk/gtkfilechooserentry.c
gtk/gtktextview.c

index 487439c72e7c066b24c30d9df7e3d90b285a6b7b..9ef794a38864c328df616929f45533435e4ad19b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-01-19  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkentry.c:
+       * gtk/gtkfilechooserentry.c:
+       * gtk/gtktextview.c: Replace several implementation of
+       blank cursor setting by GDK_BLANK_CURSOR.
+
 2009-01-19  Matthias Clasen  <mclasen@redhat.com>
 
        * gdk/gdkcursor.c:
index c9bb4ca0613de5e6ed596f14773d4e05022a4448..6ed922332f7c31bdbb217948dbce746feee7e010 100644 (file)
@@ -3782,28 +3782,15 @@ gtk_entry_motion_notify (GtkWidget      *widget,
 static void
 set_invisible_cursor (GdkWindow *window)
 {
-  GdkBitmap *empty_bitmap;
+  GdkDisplay *display;
   GdkCursor *cursor;
-  GdkColor useless;
-  char invisible_cursor_bits[] = { 0x0 };      
-       
-  useless.red = useless.green = useless.blue = 0;
-  useless.pixel = 0;
-  
-  empty_bitmap = gdk_bitmap_create_from_data (window,
-                                             invisible_cursor_bits,
-                                             1, 1);
-  
-  cursor = gdk_cursor_new_from_pixmap (empty_bitmap,
-                                      empty_bitmap,
-                                      &useless,
-                                      &useless, 0, 0);
-  
+
+  display = gdk_drawable_get_display (window);
+  cursor = gdk_cursor_new_for_display (display, GDK_BLANK_CURSOR);
+
   gdk_window_set_cursor (window, cursor);
-  
+
   gdk_cursor_unref (cursor);
-  
-  g_object_unref (empty_bitmap);
 }
 
 static void
index 94b2a9820a476773bd10eb9aee7e8fb043ec6a28..ea71fa668362b79232ba4704fcbb56757a5f892b 100644 (file)
@@ -862,31 +862,15 @@ completion_feedback_window_expose_event_cb (GtkWidget      *widget,
 static void
 set_invisible_mouse_cursor (GdkWindow *window)
 {
-  /* Stolen from gtkentry.c:set_invisible_cursor() */
-  /* FIXME: implement a stupid public gdk_window_set_invisible_mouse_cursor() */
-
-  GdkBitmap *empty_bitmap;
+  GdkDisplay *display;
   GdkCursor *cursor;
-  GdkColor useless;
-  char invisible_cursor_bits[] = { 0x0 };
-
-  useless.red = useless.green = useless.blue = 0;
-  useless.pixel = 0;
 
-  empty_bitmap = gdk_bitmap_create_from_data (window,
-                                             invisible_cursor_bits,
-                                             1, 1);
-
-  cursor = gdk_cursor_new_from_pixmap (empty_bitmap,
-                                      empty_bitmap,
-                                      &useless,
-                                      &useless, 0, 0);
+  display = gdk_drawable_get_display (window);
+  cursor = gdk_cursor_new_for_display (display, GDK_BLANK_CURSOR);
 
   gdk_window_set_cursor (window, cursor);
 
   gdk_cursor_unref (cursor);
-
-  g_object_unref (empty_bitmap);
 }
 
 static void
index 5f1331e82efaac282e06027d00afd8c3c2d0960e..e9bc867a91e3f675f990e22222ddda8b4d486492 100644 (file)
@@ -3988,28 +3988,15 @@ gtk_text_view_state_changed (GtkWidget      *widget,
 static void
 set_invisible_cursor (GdkWindow *window)
 {
-  GdkBitmap *empty_bitmap;
+  GdkDisplay *display;
   GdkCursor *cursor;
-  GdkColor useless;
-  char invisible_cursor_bits[] = { 0x0 };      
-       
-  useless.red = useless.green = useless.blue = 0;
-  useless.pixel = 0;
-  
-  empty_bitmap = gdk_bitmap_create_from_data (window,
-                                             invisible_cursor_bits,
-                                             1, 1);
-  
-  cursor = gdk_cursor_new_from_pixmap (empty_bitmap,
-                                      empty_bitmap,
-                                      &useless,
-                                      &useless, 0, 0);
-  
+
+  display = gdk_drawable_get_display (window);
+  cursor = gdk_cursor_new_for_display (display, GDK_BLANK_CURSOR);
   gdk_window_set_cursor (window, cursor);
   
   gdk_cursor_unref (cursor);
-  
-  g_object_unref (empty_bitmap);
 }
 
 static void